<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="my" uri="http://amani.com/function-taglib"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="" />
<meta name="description" content="" />
<%@ include file="../shared/common_header.jsp"%>
<title>VIP预约</title>
</head>
<body>
	<section id="orders" class="step1"> 
	<form action="${ROOT_PATH }Orders/Step2" name=""step1Form""  id="step1Form"  method=post>
		<input name="openid"  id="openid" type="hidden" value="${openid }"/> 
		<input name="ordersFactProject" id="ordersFactProject" type="hidden"/>
		<input name="xcoordinate" id="xcoordinate" type="hidden"/>
		<input name="ycoordinate" id="ycoordinate" type="hidden"/>
		<input name="sourceType" id="sourceType" type="hidden" value="Orders"/>
	</form>
	<header>
		<div>
		<!-- 
			<c:if test="${fn:length(OrdersFactProject)==0  }"> -->
			 
						<span><a  value="001">
						<!--<c:out value="${my:displayOrderFactProjectName('001')}" />-->
						</a></span>
					 
					<span>	<a  value="005">
						<!--<c:out value="${my:displayOrderFactProjectName('005')}" />-->
						</a> </span>
					<span>	<a class="styled" value="004">
						<!--<c:out value="${my:displayOrderFactProjectName('004')}" />-->
						</a> </span>
			
		<!-- </c:if> -->
			<!-- <c:if test="${fn:length(OrdersFactProject)>0  }">
				<c:forEach var="name" items="${OrdersFactProject}">-->
					 <span>
							<a class="styled" value="${name}">
							<c:out value="${my:displayOrderFactProjectName(name)}" />
							</a> </span>
			<!--	</c:forEach>
			</c:if>-->
			<div class='clear'></div>
		</div> 
	</header>
		
	 
		<div class="content">
		<div class="table-view-head" ><div>推荐产品</div></div>
			<div class="content">
			 <ul class="table-view">
			  <c:if test="${fn:length(HotProducnts)>0  }">
				<c:forEach var="item" items="${HotProducnts }">
				  <li class="table-view-cell hot-product" itemid='${item.id }' itemType='${item.type }'> 
				  	<img alt="" src="${item.mainimageurl}">
					<div class='bar'>	
						<div class=table-view-cell-colunm-left>
							<span class='product-name'>${item.name }</span> 
							<span class='product-time'>大约${item.minute }分钟</span>  
							<div class='product-details'>${my:getMaxLengthString(item.intro,10) }</div> 
						</div> 
						<div class='table-view-cell-colunm-right'>
							<div class='product-price'>￥${item.price }</div>
							<div class='product-org-price'>￥${item.originalcost })</div>
						</div>
					</div>
				 </li> 
				 </c:forEach>
				</c:if>
			</ul>
			</div>
		</div>
	</section>
	<script type="text/javascript">
	$(function(){
		 /* var openids=["orCjajnADjE1mhSo3K5gHzODwdeI",""];
	   	 var contiansId=false;
	   	 for(var i=0;i<openids;i++){
	   		 if(openids[i]=="${openid }"){
	   			 contiansId=true;
	   			 break;
	   		 }
	   	 }
	   	 if(!contiansId){
	   		 $("#orders").hide();
	   		 alert("内测期间，未受邀请用户暂时无法使用，请您见谅！");
	   	 } */
		var showPosition= function showPosition(position) {
	        $("#xcoordinate").val(position.coords.longitude);
	        $("#ycoordinate").val(position.coords.latitude);
	    };
		(function initPage(){
			$("#orders > .content").css("top",$("header").height()+29);
			navigator.geolocation.getCurrentPosition(showPosition);
		})();
		 
		$("#orders > header span").bind("click",function(e){
		  	var projectType=	$("a",e.currentTarget).attr("value");
		    $('#ordersFactProject').val(projectType);
		    $("#step1Form").submit();
		});
		$(".hot-product").bind("click",function(e){
			var id=$(this).attr('itemid');
			var type=$(this).attr('itemType');
			window.location.href='${ROOT_PATH }Storefront/detail/'+type+'/'+id;
		});
		
	});
	
	</script>
</body>
</html>